<div class="row">
	<div class="panel callout"><h6>New Attendance</h6></div>
		<?php echo validation_errors(); ?>
		<?php if(isset($system_message)) echo $system_message;?>
		<?require('grades_nav.php');?>
		
		<?if(!empty($subject) && !empty($students)):?>
			<div class="panel"><h6><?=$subject->subj_code . ' (' . $subject->subj_desc . ')';?></h6></div>
			<form action="<?=site_url(array('teacher','new_subject_attendance',$subject->subj_id));?>" class="custom submit_forms" method="POST">
				<div class="row collapse">
					<div class="small-3 large-2 columns">
						<span class="prefix">Date</span>
					</div>
					<div class="small-9 large-10 columns">
						<input type="text" name="datepicker" class="gen_datepicker" placeholder="Enter date...">
					</div>
				</div>

				<table>
					<thead>
						<tr>
							<th width="200">Student</th>
							<th width="200">Attendance</th>
							<th width="200">Reason</th>
							<th width="200">Remarks</th>
						</tr>
					</thead>
					<tbody>
						<?foreach($students AS $s):?>
						<?$id = $s->e_profile_id; ?>
						<?$id_arr[] = $id; ?>
							<tr>
								<td><?=strtoupper($s->lastname) . ', ' . ucwords($s->firstname) . ' ' . ucwords($s->middlename);?>
									<?=$s->e_profile_id?>
								</td>
								<td>
									<select name="attendance[<?=$id?>][in_class]">
										<option value="1">Present</option>
										<option value="0">Absent</option>
										<option value="2">Tardy</option>
										<option value="3">Cut Class</option>
									</select>
								</td>
								<td><input type="text" name="attendance[<?=$id;?>][reason]" value="" /></td>
								<td><input type="text" name="attendance[<?=$id;?>][remarks]" value="" /></td>
								<?=form_hidden('attendance[' . $id . '][room_id]', $s->room_id) ;?>
							</tr>
						<?endforeach;?>
					</tbody>
				</table>
				<?=form_hidden('section_id', $section_id->id); ?>
				<?=form_hidden('id_arr', $id_arr); ?>
				<a href="#" class="button small success submit_btns">Add Attendance</a>
			</form>
		<?else:?>
			<div data-alert class="alert-box">No students assigned yet.</div>
		<?endif;?>
</div>